home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / BEERSRC.ZIP / XMODE.DEF < prev    next >
Encoding:
Text File  |  1993-08-28  |  2.5 KB  |  104 lines

  1. /*-------------------------------------------------------*/
  2. /*                                                       */
  3. /*  Combined definiton file for XMODEC.C & XMODEASM.ASM  */
  4. /*                                                       */
  5. /*                                                       */
  6.  
  7.  
  8. #include "xmode.h"
  9.  
  10.  
  11. #define FALSE            0
  12. #define TRUE            1
  13.  
  14.  
  15. // VGA ports.
  16.  
  17. #define SC_INDEX        0x3c4        // Sequence Controller Index.
  18. #define GC_INDEX        0x3ce
  19. #define CRTC_INDEX        0x3d4        // CRT Controller Index.
  20. #define MISC_OUTPUT        0x3c2        // Miscellaneous Output register.
  21. #define MAP_MASK        0x2
  22. #define BIT_MASK        0x8
  23. #define INPUT_STATUS        0x3da
  24. #define START_ADDR_HIGH        0xc
  25. #define START_ADDR_LOW        0xd
  26.  
  27.  
  28. // VGA 320x240 low level graphic constants.
  29.  
  30. #define BYTESPERLINE        80
  31. #define PAGESIZE        (BYTESPERLINE * (YMAX+1))
  32. #define OFFSCREEN        (2*PAGESIZE)
  33. #define PALETTESIZE        768
  34.  
  35.  
  36. /* --- Low level sprite definition structure.
  37.    If a sprite has been pushed into the following structure it is ready
  38.    to be used by the low level sprite routines.
  39. */
  40.  
  41. struct lowspr {
  42.  
  43.    int   active;        // Is sprite active ?
  44.    int   xs;            // x size.
  45.    int   ys;                    // y size.
  46.    int   nadd;            // picture increment value.
  47.    int   maxn;                  // number of pictures * 2
  48.    int   xsalign;
  49.    int   picsize;
  50.    int     seqsize;
  51.    int   fullsize;
  52.    char  far *data;        // Sprite data: Ptr into SCREEN MEM
  53.    char  far *mask;             // Mask data: Ptr into MAIN MEM
  54.  
  55. };
  56.  
  57.  
  58. // Object states.
  59. #define O_FLASH                 0x0001
  60. struct    objstrc {
  61.  
  62.    int     active;
  63.    int     flags;            // State of the object.
  64.    int     x;            // (x, y)
  65.    int     y;
  66.    int     xa;            // (xa, ya) in active screen.
  67.    int     ya;
  68.    int     xb;
  69.    int     yb;
  70.    int     xs;
  71.    int     ys;
  72.    int     n;
  73.    int   nadd;
  74.    int     maxn;
  75.    int   cycle;            // 0-forward, 1-destroy
  76.    int   destroy;
  77.    int     sprite;
  78.  
  79. };
  80.  
  81.  
  82. struct sfieldstrc {
  83.  
  84.    int    active;        // Field active?
  85.    int    go;
  86.    int    n;            // Number of STARS in field.
  87.    struct starstrc *star;    // Pointer to array of stars.
  88.  
  89. };
  90.  
  91.  
  92. /* ----- Global data ----- */
  93.  
  94. struct lowspr      _sprite[MAXSPRITES];
  95. struct objstrc      _obj[MAXOBJS];
  96. struct sfieldstrc _sfield;
  97. unsigned      base = 0xa000;
  98. unsigned          page = 0;
  99.  
  100. int              objflashcolor = 15;    // Object flashes in white first.
  101. int               backgrndcolor = 0;    // Background is black.
  102. unsigned char     palette[PALETTESIZE];    // Palette currently in use.
  103.  
  104.